Skip to content

fix: make file logging thread-safe and surface conversion failures - #159

Merged
JackLau1222 merged 3 commits into
masterfrom
fix/logging-and-conversion-errors
Dec 2, 2026
Merged

JackLau1222 merged 3 commits into
masterfrom
fix/logging-and-conversion-errors

Conversation

@JackLau1222

@JackLau1222 JackLau1222 commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Make file logging thread-safe: lock the logger, format FFmpeg lines with av_log_format_line2, and keep progress updates out of the log file.
  • Report a real failure when the log file cannot be opened, a transcoder backend is missing, or a conversion throws. Probe media with UTF-8 paths and a safe frame-rate calculation.
  • Extend the logger tests to cover failed opens, partial FFmpeg lines, and concurrent writes.

Test plan

  • cmake --build build-tests --target OpenConverter transcoder_test against FFmpeg 6
  • ./build-tests/tests/transcoder_test --gtest_filter='LoggerTest.*' (12 tests passed)
  • Enable Settings → Enable Log File, convert a file, and confirm ~/Library/Application Support/OpenConverter/openconverter.log has timestamped lines without per-frame \r progress spam. Verified on the built app: 428 timestamped lines, 0 carriage returns, 0 frame= lines. The short test clip itself failed to encode (Invalid time base 0/1).
  • Toggle logging off and confirm the checkbox stays off after restart. Checkbox was 0 after relaunch, and settings.ini stayed fileLoggingEnabled=false.
  • Point the log path at an unwritable location and confirm the checkbox turns back off with a warning. With openconverter.log mode 000, the app showed "Could not open the log file" and the checkbox returned to off.

@JackLau1222
JackLau1222 force-pushed the fix/logging-and-conversion-errors branch 2 times, most recently from 68a0a48 to a0d2428 Compare November 22, 2026 13:25
JackLau1222 and others added 3 commits November 22, 2026 21:35
The log callback raced across threads and stored split FFmpeg lines, and a missing transcoder or a thrown conversion error could still look like success.

Co-authored-by: Cursor <cursoragent@cursor.com>
windows.h defines IsLoggingEnabled, so MSVC rewrote the method to IsLoggingEnabledA and rejected the build. The CI archive pinned to the old BtbN release returns 404, and macos-14 runners have been retired.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pin the existing third-party actions, lock the setuptools install, and stop the old wget calls from following redirects. These lines were in the tree before this pull request.

Co-authored-by: Cursor <cursoragent@cursor.com>
@JackLau1222
JackLau1222 force-pushed the fix/logging-and-conversion-errors branch from a0d2428 to c0309d2 Compare November 23, 2026 05:12
@sonarqubecloud

Copy link
Copy Markdown

@JackLau1222
JackLau1222 merged commit c1293c3 into master Dec 2, 2026
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant